package com.hankol.winecellar.adapter

import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import com.hankol.winecellar.R
import com.hankol.winecellar.utils.MyAdapter

/**
 * @author zhanglijie
 * @description:搜索历史
 * @date : 2021/05/20
 */
class SearchHistory4GoodsOrderAdapter(mContext: Context) : MyAdapter<String>(mContext) {
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        val contentView = View.inflate(parent.context, R.layout.item_search_history_layout, null)
        return HistoryViewHolder(contentView)
    }

    inner class HistoryViewHolder(itemView: View) : ViewHolder(itemView) {
        val content: TextView = itemView.findViewById(R.id.content)
        val iconHot: ImageView = itemView.findViewById(R.id.iv_hot)
        override fun onBindView(position: Int) {
            val data = data[position]
            iconHot.visibility = View.GONE
            data?.let {
                content.text = it
            }
        }
    }
}